
<!-- saved from url=(0052)http://wms6.zoho.com/wms.html?&nocache=1234145135376 -->
<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=gb18030">
  </HEAD><BODY onabort="cleanup();" onunload="cleanup();">
<SCRIPT>
document.domain="zoho.com";

/* set up browser checks and add a simple emulation for IE4 */
// check browsers
var op = /opera 5|opera\/5/i.test(navigator.userAgent);
var ie = !op && /msie/i.test(navigator.userAgent);	// preventing opera to be identified as ie
var mz = !op && /mozilla\/5/i.test(navigator.userAgent);	// preventing opera to be identified as mz
if (!ie && document.layers)

	var browser_nn4=true

else if (document.layers || (!document.all && document.getElementById))

	var browser_nn6=true

</SCRIPT>
<SCRIPT>

var wmsEventAjax;

//var subDomain = "zoho.com";

var sesTimer;
var disableevent = false;

function cleanup()
{
	try
	{
		if(wmsEventAjax)
		{
			disableevent=true;	
			wmsEventAjax.abort();
		}
	}catch(e){}

}



function getUrl(url)
{    
	try{

	if(wmsEventAjax && wmsEventAjax.readyState!=0 && wmsEventAjax.readyState!=4)
	{
		wmsEventAjax.onreadystatechange = function() { }
		//wmsEventAjax.abort();
	}

	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
		wmsEventAjax=new XMLHttpRequest();
	// code for IE
	else if (window.ActiveXObject)
  		wmsEventAjax=new ActiveXObject("Microsoft.XMLHTTP");
	if (wmsEventAjax)
    		wmsEventAjax.onreadystatechange=wmsEvent;
	else
		wmsEventAjax = false;

	

	wmsEventAjax.open("GET",url+"&nocache="+((new Date()).getTime()),true);
	wmsEventAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
	if(ie) wmsEventAjax.send(); else wmsEventAjax.send(null);
     }
     catch(e){
	     //alert('unable to connect');
     } 
}


function wmsEvent()
{
	try
	{
	if(wmsEventAjax.readyState == 4)
	{
		if(wmsEventAjax.status == 200)
		{
			var response = wmsEventAjax.responseText;	
			var wdata = eval(response);
			push(wdata);	
			setTimeout("bind()",1);
		}		
		else
		{
			
			if(wmsEventAjax.status!=500 && wmsEventAjax.status!=304 && wmsEventAjax.status!=404 && wmsEventAjax.status!=400)
			{
				try{parent.goOffline();}catch(ee){}
			}
			setTimeout("bind()",10000);
		}
		
	}
	}
	catch(e)
	{
		try{parent.goOffline();}catch(ee){}
		try
		{
			setTimeout("bind()",10000);
		}
		catch(e1)
		{
		}
	}	
}

function disablewms()
{
	parent.disablewms();
}

function isdisablewms()
{
	try{
	return parent.isdisablewms();
	}catch(e){return false;}
}

function push(msg)
{
     try
     {
	     //var oldDomain = document.domain;
	     //document.domain=subDomain;

	     try
	     {
	     	for(i=0;i<msg.length;i++)
	     	{
			     try
			     {	
				     	parent.push(msg[i]);
			     }
			     catch(e){}
		}
	     }
	     catch(e1)
	     {		     
	     }
	     //document.domain=oldDomain;		     
     }
     catch(e)
     {	     
     }
}

function register()
{
	//var oldDomain = document.domain;
	//document.domain=subDomain;
	var prd=parent.getPrd();
	var uname='';
	var zuid='';
	var nname='';
	try{uname=parent.getUserName();}catch(e2){}
	try{zuid=parent.getZuid();}catch(e){}
	try{nname=parent.getNickName();}catch(e1){}
	//document.domain=oldDomain;
	var url = "register?prd="+prd;
	if(uname != ''){url=url+'&uname='+uname;}
	if(zuid != ''){url=url+'&zuid='+zuid;}
	if(nname != ''){url=url+'&nname='+nname;}
	getUrl(url+'&domain=a');
}

function bind()
{
	if(isdisablewms() || disableevent)return;

	//var oldDomain = document.domain;
	//document.domain=subDomain;
	var ck=parent.getPrd()+":"+parent.getUserId();
	var sid=parent.getSid();
	var isRecon = parent.isReconnecting();
	parent.plive();
	//document.domain=oldDomain;
	if(!isRecon)
	{
		getUrl("wmsevent?c="+ck+"&i="+sid);		
	}	
	if(sesTimer!=null)
	{
		clearTimeout(sesTimer);
		sesTimer = null;
	}

	try
	{
		sesTimer = setTimeout("bind()",30000);
	}
	catch(e)
	{
	}
}

window.onload = function()
{
	register();
}

</SCRIPT>

  
 
  
</BODY></HTML>